home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 2 / LSD and 17bit Compendium Deluxe - Volume II.iso / a / prog / misc / iffed_v1.01.lha / iff.stc < prev    next >
Encoding:
Text File  |  1994-11-13  |  5.3 KB  |  339 lines

  1. /* Tab size 4 */
  2.  
  3. typedef unsigned char        uchar;
  4. typedef unsigned short        ushort;
  5. typedef unsigned long        ulong;
  6. typedef    char                string;
  7. typedef    char                *strptr;
  8.  
  9.  
  10.  
  11. /*
  12.     IFF types
  13. */
  14.  
  15. strptr    "????" = "Unknown";
  16. strptr     ILBM  = "Picture";
  17. strptr     SMUS  = "Music";
  18. strptr    "8SVX" = "Sample";
  19. strptr     RESC  = "Resource";
  20. strptr     CTLG  = "Catalog";
  21. strptr     FTXT  = "Text";
  22. strptr    "MAP " = "Map";
  23. strptr     PREF  = "Preference";
  24. strptr     WORD  = "Document";
  25.  
  26.  
  27.  
  28.  
  29. /*
  30.     Non specific chunks
  31. */
  32.  
  33. strptr                    "*NAME";
  34. strptr                    "*ANNO";
  35. strptr                    "*CHRS";
  36. strptr                    "*(c) ";
  37. strptr                    "*AUTH";
  38. strptr                    "*FVER";
  39. char                    "*BODY"[];        /* List of bytes */
  40. struct ColorMap            "*CMAP"[];        /* List of red/green/blue */
  41.  
  42.  
  43.  
  44.  
  45. /* ILBM chunks */
  46.  
  47.  
  48. struct BitMapHeader {
  49.     ushort        width;                /* Sizes */
  50.     ushort        height;
  51.     ushort        xPos;                /* Positions */
  52.     ushort        yPos;
  53.     uchar        nPlanes;            /* Depth */
  54.     uchar        masking;            /* Mask mode */
  55.     uchar        compression;        /* Compression mode */
  56.     char        PAD;                /* unused */
  57.     short        transparentColor;    /* The transparent color number */
  58.     uchar        xAspect;            /* Picture Deformation */
  59.     uchar        yAspect;
  60.     ushort        pageWidth;            /* Size of the page to display this picture */
  61.     ushort        pageHeight;
  62. };
  63.  
  64. struct ColorMap {
  65.     uchar        red;
  66.     uchar        green;
  67.     uchar        blue;
  68. };
  69.  
  70. struct ColorRange {
  71.     short        PAD;
  72.     ushort        rate;
  73.     ushort        active;
  74.     uchar        low;
  75.     uchar        high;
  76. };
  77.  
  78. struct GraphicCraft {
  79.     short        direction;
  80.     uchar        start;
  81.     uchar        end;
  82.     ushort        seconds;
  83.     ushort        microseconds;
  84.     short        PAD;
  85. };
  86.  
  87. struct Point2D {
  88.     short        x;
  89.     short        y;
  90. };
  91.  
  92. struct DestinationMerge {
  93.     uchar        depth;
  94.     char        PAD;
  95.     ushort        planePick;
  96.     ushort        planeOnOff;
  97.     ushort        planeMask;
  98. };
  99.  
  100.  
  101.  
  102.  
  103.  
  104. struct BitMapHeader        *ILBMBMHD;        /* A bitmap definition */
  105.  
  106. struct BitMapHeader        *CHNKBMHD;        /* A bitmap definition for chunky IFF */
  107.  
  108. short                    *ILBMSPRT;
  109.  
  110. struct ColorRange        *ILBMCRNG;
  111.  
  112. struct GraphicCraft        *ILBMCCRT;
  113.  
  114. struct Point2D            *ILBMGRAB;
  115.  
  116. struct DestinationMerge    *ILBMDEST;
  117.  
  118. long                    *ILBMCAMG;
  119.  
  120.  
  121.  
  122. /* 8SVX chunks */
  123.  
  124. struct Voice8Header {
  125.     ulong    oneShotHiSamples;
  126.     ulong    repeatHiSamples;
  127.     ulong    samplesPerHiCycle;
  128.     ushort    samplesPerSec;
  129.     uchar    ctOctave;
  130.     uchar    sCompression;
  131.     ulong    volume;
  132. };
  133.  
  134. struct AttackRelease {
  135.     ushort    duration;
  136.     ulong    dest;
  137. };
  138.  
  139.  
  140. struct Voice8Header        *"8SVXVHDR";
  141. struct AttackRelease    *"8SVXATAK";
  142. struct AttackRelease    *"8SVXRLSE";
  143. short            *"8SVXCHAN";
  144.  
  145.  
  146.  
  147.  
  148.  
  149. /* CTLG format */
  150.  
  151.  
  152. struct StringList {
  153.     long    identifier;
  154.     long    size;
  155.     char    szstring[];
  156. };
  157.  
  158.  
  159.  
  160. strptr                    CTLGLANG;
  161. struct StringList        CTLGSTRS[];
  162. char            CTLGCSET[];
  163.  
  164.  
  165.  
  166.  
  167.  
  168. /*
  169.     The following are good examples.
  170.     They are the definition of the structure present into my
  171.     resource files
  172. */
  173.  
  174. struct RWindow {
  175.     short        Left;
  176.     short        Top;
  177.     ushort        Width;
  178.     ushort        Height;
  179.     ulong        Flags;
  180.     ulong        IDCMP;
  181.     ulong        Prefs;
  182.     uchar        OptionFlags;
  183.     uchar        PAD;
  184.     ushort        MinWidth;
  185.     ushort        MinHeight;
  186.     ushort        MaxWidth;
  187.     ushort        MaxHeight;
  188. };
  189.  
  190. struct RGadget {
  191.     ushort        ID;
  192.     ushort        Parent;
  193.     uchar        Type;
  194.     uchar        SubType;
  195.     short        Left;
  196.     short        Top;
  197.     ushort        Width;
  198.     ushort        Height;
  199.     uchar        Flags;
  200.     uchar        TextHorizJust;
  201.     uchar        TextVertJust;
  202.     uchar        TextColor;
  203.     short        TextInterline;
  204.     ushort        TextBorderLeft;
  205.     ushort        TextBorderRight;
  206.     uchar        BorderType;
  207.     uchar        BorderColor;
  208.     uchar        BorderTopColor;
  209.     uchar        BorderBottomColor;
  210.     uchar        PictureFlags;
  211.     uchar        reserved;
  212. };
  213.  
  214. struct RFunction {
  215.     ushort        Type;
  216.     uchar        Flags;
  217.     char        reserved;
  218.     ushort        Link;
  219.     strptr        String;
  220. };
  221.  
  222. struct RMenuHeader {
  223.     uchar        Flags;
  224.     uchar        BackColor;
  225.     uchar        BorderType;
  226.     uchar        BorderTopColor;
  227.     uchar        BorderBottomColor;
  228.     uchar        BorderColor;
  229.     short        BorderLeft;
  230.     short        BorderTop;
  231.     ushort        BorderRight;
  232.     ushort        BorderBottom;
  233.     ushort        InsideXBorder;
  234.     ushort        InsideYBorder;
  235.     ushort        Interline;
  236.     ushort        Empty;
  237.     ushort        Separator;
  238.     ushort        Vertical;
  239.     ushort        TextXBorder;
  240.     ushort        InterSeparator;
  241.     uchar        CheckMarkType;
  242.     uchar        Speed;
  243.     uchar        Remain;
  244.     char        reserved;
  245. };
  246.  
  247. struct RColor {
  248.     uchar        NormalText;
  249.     uchar        SelectedText;
  250.     uchar        NormalBack;
  251.     uchar        SelectedBack;
  252. };
  253.  
  254. struct RMenu {
  255.     uchar        Type;
  256.     uchar        Flags;
  257.     uchar        Depth;
  258.     uchar        TextJust;
  259.     struct RColor    Colors;
  260. };
  261.  
  262. struct RPicture {
  263.     uchar        Flags;
  264.     char        PAD;
  265.     ushort        Link;
  266. };
  267.  
  268. struct RPattern {
  269.     ushort        Height;
  270.     uchar        Color;
  271.     char        PAD;
  272.     char        Data[];
  273. };
  274.  
  275. struct REdit {
  276.     uchar        Flags;
  277.     uchar        SelTextColor;
  278.     uchar        SelBackColor;
  279.     uchar        EmptyColor;
  280.     uchar        DisplayFlags;
  281.     uchar        Border;
  282.     uchar        CurTextColor;
  283.     uchar        CurBackColor;
  284.     uchar        CursorFlags;
  285.     uchar        CursorWidth;
  286.     ushort        CursorSpeed;
  287.     ushort        MinimumSize;
  288.     ushort        BufferSize;
  289. };
  290.  
  291. struct RList {
  292.     uchar        Flags;
  293.     uchar        SelectedColor;
  294.     uchar        PicturePosition;
  295.     char        PAD;
  296.     ushort        BorderLeft;
  297.     ushort        BorderRight;
  298.     ushort        BorderTop;
  299.     ushort        BorderBottom;
  300. };
  301.  
  302. struct RFont {
  303.     ushort        YSize;
  304.     uchar        Style;
  305.     uchar        Flags;
  306.     strptr        Name;
  307. };
  308.  
  309. struct RType {
  310.     ushort        Type;
  311.     strptr        Name;
  312. };
  313.  
  314. strptr                    RESCTEXT;
  315. strptr                    RESCWMSG;
  316. strptr                    RESCACTV;
  317. strptr                    "RESCUP  ";
  318. strptr                    "RESCTOP ";
  319. strptr                    RESCDOWN;
  320. strptr                    RESCBTTM;
  321. strptr                    RESCNEXT;
  322. strptr                    RESCPREV;
  323. strptr                    RESCLINK;
  324. strptr                    RESCPRNT;
  325. struct RWindow            *RESCWIND;
  326. struct RGadget            *RESCGADG;
  327. struct RFunction        *RESCFUNC;
  328. strptr                    RESCMFNC;
  329. struct RMenuHeader        *RESCMNHD;
  330. struct RMenu            *RESCMENU;
  331. struct RPicture            *RESCPINF;
  332. struct RPattern            *RESCPATN;
  333. ushort                    *RESCFCUS;
  334. struct REdit            *RESCEDIT;
  335. struct RList            *RESCLIST;
  336. struct RFont            *RESCFONT;
  337. struct RType            *RESCTYPE;
  338.  
  339.